<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Panel</title>
</head>
<!--
Copyright 2010 Gerschel A. Payne
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

This is an example panel, it is not formatted for looks and the code can use some cleaning.
You will only be able to install from a small set of programs using this code, just follow the comments and the wiki article for more information.

Your key would need access to:
one-click_list_advanced
one-click_install_advanced
one-click_destroy_advanced

From the main page you will see three radio buttons (form1)
list of installs
install
remove

When you submit the list of installs, you will be directed to a page displaying an iframe that shows the list of installs

When you submit the install, you will be directed to a page displaying a text box where you can type in the folder for the install and select the install program (form2)
		After that submittal, you will be on a page that displays an iframe that has the feedback 
        from the API (success, or errors)

When you submit the remove, you will be directed to a page that displays a text box where you can type in the folder that the desired program was installed (form3)
		That program will be removed, but your database and folder will remain
 -->
<body bgcolor="#CCFFFF">
<div style="background-color:#00cccc; border-style:ridge; border-color:#993300; border-width:10px">
<?php
//____________________________________________________________________________________________
//Please run setup.php first to setup your key; domain; and to enter your database name
include_once 'config/config.php';
?>
<!--
____________________________________________________________________________________________
_____________________________________Greeting_______________________________________________
-->
<p align="center">Welcome to your custom panel<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="config/setup.php">Setup</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="panel.php">Start Over</a><br /><br /><a href="http://www.dreamhost.com/donate.cgi?id=13171"><img border="0" alt="Donate towards my web hosting bill!" src="https://secure.newdream.net/donate3.gif" /></a></p><br />
<?php

//____________________________________________________________________________________________
//_________________________If Form 2 was submitted____________________________________________

	if (isset($_POST["submit2"])){
		$rg2folder = $_POST["RadioGroup2folder"];
		
//____________________________________________________________________________________________
//__________Enter your url in the setup.php i.e. example.com_________________________
		$url = "http://$domain/$rg2folder";
		$type = $_POST["RadioGroup2install"];
		
//____________________________________________________________________________________________
//______Setup your database name in setup.php i.e. your_database_com
		$install = "https://api.dreamhost.com/?key=$key&cmd=oneclick-install_advanced&url=$url&type=$type&database=$dbname";
	?>
<!--
_______________________________________________________________________________________________
____________The iframe that outputs the results of error or success of install_________________
-->
		 <div align="center">
         <iframe height="300px" width="700px" scrolling="yes" src="<?php echo "$install"; ?>" />
         </div>
	<?php

//____________________________________________________________________________________________
//_____Checks if Form1 was submitted and if remove was the option ocd = one-click_destroy_____
//___________________________________takes you to form 3______________________________________

	}else if ($_POST['RadioGroup1'] == 'ocd' && isset($_POST["submit"])){
	?>
<!--
_______________________________Form3__________________________________________________________
-->
    	<form  id="form3" name="form3" method="post" action=""/>
    		<fieldset>
            <legend>One Click Destroy</legend>
            <p>
    		<lable>
    		<input type="text" name="RadioGroup3folder" value="" id="RadioGroup3_0" />Installed folder</label>
        	<br />
        	</p>
            <input name="submit3" type="submit" value="submit" />			
            </fieldset>
    	</form>
	<?php
	
//____________________________________________________________________________________________
//_________________Checks if form 3 was submitted ( the remove parameters )___________________
	    
	}else if (isset($_POST['submit3'])){
		$folder = $_POST['RadioGroup3folder'];
		
//____________________________________________________________________________________________
// Setup your site url you want the folder in by running setup.php, i.e. example.com
		$url = "http://$domain/$folder";
		
//____________________________________________________________________________________________
// If you want to remove it from list but not uninstall it, then change deletefiles=0
		
		$remove =  "https://api.dreamhost.com/?key=$key&cmd=oneclick-destroy_advanced&url=$url&deletefiles=1"
	?>
<!--
______________________________________________________________________________________________
______________The iframe that displays the results of removal (success or error)______________
-->
    	 <div align="center">
         <iframe align="center" width="700px" height="300px" scrolling="yes" src="<?php echo "$remove"; ?>" />
         </div>
    <?php

//____________________________________________________________________________________________
//________Checks if form1 was submitted and if the value was one-click_list = ocl_____________
	
	}else if ($_POST['RadioGroup1'] == 'ocl' && isset($_POST["submit"])){
		$cmd = "oneclick-list_advanced";
		$LINK = "https://api.dreamhost.com/?key=$key&cmd=$cmd";
	?>
<!--
______________________________________________________________________________________________
The iframe that displays the list
 -->    
    
		 <div align="center">
         <iframe align="center" width="700px" height="300px" scrolling="yes" src="<?php echo "$LINK"; ?>"/>
         </div>
	<?php

//____________________________________________________________________________________________
//___Checks to see if form1 was submitted and if one-click_install was the selection = oci____
	
	}else if ($_POST["RadioGroup1"]=="oci" && isset($_POST["submit"])){
	?>
<!--
______________________________________________________________________________________________
______________________________Form2___________________________________________________________
-->
		<form id="form2" name="form2" method="post" action=""/>
			<fieldset>
            <legend>One Click Install</legend>
            <p>
    		<lable>
    		<input type="text" name="RadioGroup2folder" value="" id="RadioGroup2_0" />Folder</label>
    		<br />
    		<lable>
            
<!--
______________________Add or remove the types of programs here________________________________
-->
    		<select name="RadioGroup2install" size="13">
      			<option value="phpbb">phpbb</option>
      			<option value="joomla">joomla</option>
      			<option value="gallery">gallery</option>
      			<option value="wordpress">wordpress</option>
                <option value="mediawiki">mediawiki</option>
                <option value="webcalendar">webcalendar</option>
                <option value="zencart">zencart</option>
                <option value="phpgedview">phpgedview</option>
                <option value="openx">openx</option>
                <option value="pligg">pligg</option>
                <option value="dotproject">dotproject</option>
                <option value="moodle">moodle</option>
                <option value="statusnet">statusnet</option>
				<option value="piwik">piwik</option>
    		</select>Select Install</label>
    		</p>
            <input name="submit2" type="submit" value="submit" />    		
            </fieldset>
    	</form>
	<?php
	
//____________________________________________________________________________________________
//_________________________________Form1______________________________________________________
//____________________________Default Display_________________________________________________
	}else{
	?>
		<p>What would you like to do?</p>
		<form id="form1" name="form1" method="post" action="">
  			<fieldset>
            <legend>Main Panel</legend>
            <p>
    		<label>
    		<input type="radio" name="RadioGroup1" value="ocl" id="RadioGroup1_0" />List OneClick</label>
    		<br />
    		<label>
    		<input type="radio" name="RadioGroup1" value="oci" id="RadioGroup1_1" />One Click Install</label>
    		<br />
    		<label>
    		<input type="radio" name="RadioGroup1" value="ocd" id="RadioGroup1_2" />One Click Remove</label>
    		<br />
  			</p>
  			<input type="submit" name="submit" id="submit" value="Submit" />
            </fieldset>
		</form>
	<?php
	}
	?>
<p align="center">Copyright Gerschel Payne<br />Please leave feedback on <a href="http://groups.google.com/group/dreamhost-api-php-webpanel/topics">dreamhost-api-php-webpanel google group</a><br />
View Apache 2.0 License <a href="http://www.apache.org/licenses/LICENSE-2.0">Here</a></p>
    </div>
</body>
</html>
